Every tween operation is based on a collection of one or more values from which a range of output values can be algorithmically derived. Each tween is assigned a time duration, and an output value can be generated for any time value within the duration. In the simplest kind of tween operation, a pair of values is provided as input and values between the two values are generated as output. For example, if the tween data is a pair of integers, 0 and 5, the duration of the tween operation is 100, and the algorithm used to generate output values is linear interpolation (in which generated values, when graphed, fall on a straight line between the input values), the output returned for a time value of 0 is 0, the output for 25 is 1.25, the output for 50 is 2.5, and the output for 100 is 5.
QuickTime supports a variety of tween types . Each tween type is distinguished from other types by these characteristics:
Tween operations for each tween type are performed by a tween component that is specific to that type or, for a number of tween types that are native to QuickTime, by QuickTime itself. Movies and applications that use tweens do not need to specify the tween component to use; QuickTime identifies a tween type by its tween type identifier and automatically routes its data to the correct tween component or to QuickTime. If you need to perform tween operations that QuickTime does not support, you can develop a new tween component, as described in "Creating a Tween Component" .
When a movie contains a tween track, the tween media handler (described in ) invokes the necessary component (or built-in QuickTime code) for tween operations and delivers the results to another media handler. The receiving media handler can then use the values it receives to modify its playback. For example, the data in a tween track can be used to alter the volume of a sound track.
Tweens can also be used outside of movies by applications or other software that can use the values they generate.
| Previous | Chapter Contents | Chapter Top | Next |